/*
 * Copyright 2007-2008 Andrew O'Malley
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package ws.quokka.plugin.maven;

import ws.quokka.core.repo_spi.RepoArtifactId;

import java.io.File;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;


/**
 *
 */
public class MavenDependency {
    //~ Instance fields ------------------------------------------------------------------------------------------------

    private MavenId mavenId;
    private Set dependencies = new HashSet();
    private File file;
    private Boolean optional;
    private String state;
    private RepoArtifactId id;
    private boolean requiresImport;

    //~ Constructors ---------------------------------------------------------------------------------------------------

    public MavenDependency() {
    }

    public MavenDependency(MavenId mavenId, Set dependencies) {
        this.mavenId = mavenId;
        this.dependencies = dependencies;
    }

    //~ Methods --------------------------------------------------------------------------------------------------------

    public RepoArtifactId getId() {
        return id;
    }

    public void setId(RepoArtifactId id) {
        this.id = id;
    }

    public MavenId getMavenId() {
        return mavenId;
    }

    public void setMavenId(MavenId mavenId) {
        this.mavenId = mavenId;
    }

    public Set getDependencies() {
        return Collections.unmodifiableSet(dependencies);
    }

    public void addDependency(MavenDependency dependency) {
        dependencies.add(dependency);
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public Boolean getOptional() {
        return optional;
    }

    public void setOptional(Boolean optional) {
        this.optional = optional;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public boolean isRequiresImport() {
        return requiresImport;
    }

    public void setRequiresImport(boolean requiresImport) {
        this.requiresImport = requiresImport;
    }
}
